package prj3;

import prj3.exceptions.EmptyListException;

/**
 * Defines a 4-sided cell that has
 * information about its area and borders
 * @author romain
 *
 */
public interface ICell {

	
	/**
	 * Gets the coordinate for this cell
	 * @return
	 */
	public ICoordinate getCoordinate();
	
	/**
	 * Gets the area of the cell
	 * @return float 
	 */
	public float getArea();
	
	/**
	 * Gets the lenght of the side specified by direction
	 * Direction is defined in ICoordinate (DIR_TOP, DIR_BOTTOM, DIR_LEFT, DIR_RIGHT)
	 * @param direction
	 * @return float
	 * @see ICoordinate
	 */
	public float getSideLength(int direction);
	
	/**
	 * Gets the total length for all sides
	 * @return
	 */
	public float getTotalSideLength();
	
	/**
	 * Returns true if this cell is mutable (ie: its value can be changed)
	 * @return boolean
	 */
	public boolean isMutable();
	
	/**
	 * Sets whether this cell is mutable
	 * @param mutable
	 */
	public void setMutable(boolean mutable);
	
	/**
	 * Gets the value for this cell
	 * @return float
	 */
	public float getValue();
    
    /**
     * Perform a destructive get of the value (if applicable)
     * @return float
     * @throws EmptyListException 
     */
    public float takeValue() throws EmptyListException;
	
	/**
	 * Sets the value for this cell
	 * @param value
	 * @throws AssertionError if the cell is not mutable
	 */
	public void setValue(float value);
}
